import Vue from 'vue'
import App from './App'
import store from './store'
import tui from './common/httpRequest'
import web3Rpc from './common/web3Rpc.js'
Vue.config.productionTip = false
// #ifdef H5
window.QQmap = null;
// #endif
// #ifndef MP-TOUTIAO
//网络监听
import messages from './locale/index'
import VueI18n from 'vue-i18n'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'
Vue.use(uView);

// 引入uView对小程序分享的mixin封装
let mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)

Vue.use(VueI18n)
let i18nConfig = {
  locale: uni.getLocale(),
  messages
}
const i18n = new VueI18n(i18nConfig)

setTimeout(() => {
	uni.onNetworkStatusChange(function(res) {
		//console.log(res.networkType);
		store.commit("networkChange", {
			isConnected: res.isConnected
		})
	});
}, 100)
// #endif

Vue.prototype.tui = tui
Vue.prototype.web3Rpc=web3Rpc
Vue.prototype.$eventHub = Vue.prototype.$eventHub || new Vue()
Vue.prototype.$store = store
App.mpType = 'app'

const app = new Vue({
	 i18n,
	store,
	...App
})
app.$mount()
